package com.ruoyi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * 启动程序
 *
 * @author ruoyi
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class RuoYiApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(RuoYiApplication.class, args);

        Environment environment = run.getBean(Environment.class);
        String property = environment.getProperty("server.port");
//        System.out.println("访问链接：http://localhost:" +environment.getProperty("server.port")+environment.getProperty("server.servlet.context-path");
        System.out.println("" +
                "+----------------------------------------+ \n" +
                "| Document Address...                    | \n" +
                "+----------------------------------------+\n" +
                "| Project started successfully!          | \n" +
                "| http://localhost:" + property + "                  | \n" +
                "| ...                                    | \n" +
                "+----------------------------------------+  ");
    }
}